use dataset_county, clear

collapse ddem flip*, by(year)

keep if flipdemrep != .

#delimit;

gr tw
	(con flipdemrep year, col(black))
	(con fliprepdem year, col(gray) msym(s))
	,
		xlab(1960(4)2016, angle(45))
		ylab(, angle(horiz))
		legend(off)
		plotregion(style(none))
		xtitle("Year")
		ytitle("Proportion of all counties")
		text(0.4 1972 "Flipped R{&rarr}R{&rarr}D", col(gray))
		text(0.25 2004 "Flipped D{&rarr}D{&rarr}R", col(black))
		;
	
#delimit cr

gr export "figure 1.pdf", replace
